package com.github.llyb120.dsl

import org.junit.Test

class DslTest {

    @Test
    void test(){
        def a = new AbstractDslMaker(){
            @Override
            DslParser createParser() {
                return parser {
                    element {
                        name "flow"
                        property{
                            name "actor"
                            type Object.class
                            multiple true
                        }
                        property {
                            name "node"
                            type Object.class
                            multiple true
                        }
                        property {
                            name "name"
                        }
                    }
                    element {
                        name "actor"
                        property {
                            name "name"
                        }
                        property {
                            name "define"
                            type String.class
                        }
                        property {
                            name "define"
                            type Closure.class
                        }
                    }
                    element {
                        name "node"
                        property {
                            name "name"
                        }
                        property {
                            name "who"
                        }
                        property {
                            name "to"
                            type String.class
                        }
                        property {
                            name "to"
                            type Object.class
                        }
                    }
                    element {
                        name "to"
                        property {
                            name "which"
                        }
                        property {
                            name "dynamic"
                            type Closure.class
                        }
                    }
                }
            }
        }.createParser()
                .generate("D:\\work\\flow\\src\\main\\groovy\\com\\github\\llyb120\\testflow", "com.github.llyb120.testflow");

        println a
    }
}
